package com.zwkj.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zwkj.pojo.vo.WFileTVo;
import com.zwkj.service.IWFileVersionTService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

import org.springframework.beans.BeanUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zwkj.domain.WFileT;
import com.zwkj.service.IWFileTService;
import com.zwkj.mapper.WFileTMapper;
import org.springframework.stereotype.Service;

/**
 * @author 小间隙
 * @description 针对表【w_file_t】的数据库操作Service实现
 * @createDate 2023-12-11 11:32:31
 */
@Service
public class WFileTServiceImpl extends ServiceImpl<WFileTMapper, WFileT>
        implements IWFileTService {

    @Autowired
    private IWFileTService wFileTService;


    @Override
    public void addWFileT(WFileTVo wFileTVo) {
        WFileT wFileT = new WFileT();
        BeanUtils.copyProperties(wFileTVo, wFileT);

        wFileTService.save(wFileT);
    }

    @Override
    public IPage<WFileTVo> getWFileTPageList(IPage<WFileTVo> page, WFileTVo wFileTVo) {
        return this.baseMapper.getWFileTPageList(page, wFileTVo);
    }


    @Override
    public List<WFileTVo> getWFileTList(WFileTVo wFileTVo) {
        return this.baseMapper.getWFileTList(wFileTVo);

    }

    @Override
    public WFileT getWFileTById(String id) {
        return wFileTService.getById(id);
    }


    @Override
    public void delWFileT(String id) {
        wFileTService.removeById(id);
    }

    @Override
    public void fileRename(String fileId, String name) {
        WFileT wFileT = new WFileT();
        wFileT.setId(Long.valueOf(fileId));
        wFileT.setName(name);
        wFileTService.updateById(wFileT);
    }


    @Override
    public void updateWFileT(WFileTVo wFileTVo) {
        WFileT wFileT = new WFileT();
        BeanUtils.copyProperties(wFileTVo, wFileT);
        wFileTService.updateById(wFileT);
    }
}




